package com.ryan.mdp.exception;

public class MdpError extends Error {
    private static final long serialVersionUID = 1L;
    private final String errorCode;

    public MdpError(String errorCode, Object... args) {
        super("ErrorCode:" + errorCode + ", " + MdpMessages.getMessage(errorCode, args));
        this.errorCode = errorCode;
    }

    public MdpError(String errorCode, Throwable throwable, Object... args) {
        super("ErrorCode:" + errorCode + ", " + MdpMessages.getMessage(errorCode, args), throwable);
        this.errorCode = errorCode;
    }

    public String getErrorCode() {
        return errorCode;
    }
}
